Python 3.11.0 | packaged by conda-forge | (main, Jan 16 2023, 14:12:30) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.

In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'SemiFullRunSept29')
df = get_data_frame(MEASURE_FOLDER)
df.drop(columns='betaPAErr', inplace=True)
df.dropna(inplace=True)

dfc = df.copy()
df_grouped = df.groupby(by=['pump_reference', 'pump_AOM_freq'])
groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

max_freqs = [384182.3]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))

fig1, ax1s = plt.subplots(5)    # detuning
fig1size = (30, 8)
fig2, ax2s = plt.subplots(2) # pump_reference
fig2size = (12, 8)

for i, (df, max_freq)  in enumerate(zipped_data[:]):
    j1 = i//2
    j2 = i%2
    
    data = df.dropna()
    data = data[data['ratio'] < 1.3]
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-0.0)*FREQVSCURR)
    
    pref = data.iloc[0]['pump_reference'] 
    detuning = 180-2*data.iloc[0]['pump_AOM_freq'] 
    
    
    ax1s[j1] = plot_spline_fit(ax1s[j1], 
                               x=freqs, y=data['ratio'], yerr=data['ratioErr']
                               ,scolor=f'C{j2}', mfc=f'C{j2}',color=f'C{j2}'
                               ,s=0.0, ms=5,linewidth=1.5, figsize=fig1size,
                               ,label=f"Pump Amplitude = {pref:.2f}", fig=fig1)
    
    ax1s[j1].set_title(f"Detuning  = {detuning:.2f}", **titledict)
    ax1s[j1].legend()
    
    ax2s[j2] = plot_spline_fit(ax2s[j2], 
                               x=freqs, y=data['ratio'], yerr=data['ratioErr'],
                               scolor=f'C{j1}', mfc=f'C{j1}',color=f'C{j1}', 
                               s=0.0, ms=5, linewidth=1.5, figsize=fig2size,
                               label=f"Detuning  = {detuning:.2f}", fig=fig2)
    
    ax2s[j2].set_title(f"Pump Amplituide = { pref:.2f}", **titledict)
    ax2s[j2].legend()
    
fig1.tight_layout()
fig2.tight_layout()

fig1.savefig(os.path.join(MEASURE_FOLDER, 'lossFeaturesDet.png'))
plt.show()
plt.close()

fig2.savefig(os.path.join(MEASURE_FOLDER, 'lossFeaturesPA.png'))
plt.show()
plt.close()
  Cell In[11], line 35
    ,label=f"Pump Amplitude = {pref:.2f}", fig=fig1)
    ^
SyntaxError: invalid syntax
In [ ]:
plt.plot(dfc['pump_AOM_freq'])
Out[ ]:
[<matplotlib.lines.Line2D at 0x14ef992b590>]
In [ ]:
plt.plot(dfc['pump_reference'])
Out[ ]:
[<matplotlib.lines.Line2D at 0x14e81d9b590>]
In [ ]:
([df['pump_reference'].mean() for df in dfs])
Out[ ]:
[1.1199999999999997,
 1.1199999999999997,
 1.1199999999999997,
 1.1199999999999997,
 1.1199999999999997,
 1.4899999999999998,
 1.4899999999999998,
 1.4899999999999998,
 1.4899999999999998,
 1.4899999999999998]
In [ ]:
([df['pump_AOM_freq'].mean() for df in dfs])
Out[ ]:
[83.0, 84.0, 85.0, 86.0, 86.5, 83.0, 84.0, 85.0, 86.0, 86.5]
In [ ]:
([(df['pump_reference'].mean(),df['pump_AOM_freq'].mean()) for df in dfs])
Out[ ]:
[(1.1199999999999997, 83.0),
 (1.1199999999999997, 84.0),
 (1.1199999999999997, 85.0),
 (1.1199999999999997, 86.0),
 (1.1199999999999997, 86.5),
 (1.4899999999999998, 83.0),
 (1.4899999999999998, 84.0),
 (1.4899999999999998, 85.0),
 (1.4899999999999998, 86.0),
 (1.4899999999999998, 86.5)]
In [ ]:
([(df.dropna()['pump_reference'].mean(),df.dropna()['pump_AOM_freq'].mean()) for df in dfs])
Out[ ]:
[(1.1199999999999997, 83.0),
 (1.1199999999999997, 84.0),
 (1.1199999999999997, 85.0),
 (1.1199999999999997, 86.0),
 (1.1199999999999997, 86.5),
 (1.4899999999999998, 83.0),
 (1.4899999999999998, 84.0),
 (1.4899999999999998, 85.0),
 (1.4899999999999998, 86.0),
 (1.4899999999999998, 86.5)]
In [ ]:
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    print(df.dropna()['pump_reference'].mean(),df.dropna()['pump_AOM_freq'].mean())
1.1199999999999997 83.0
1.1199999999999997 84.0
1.1199999999999997 85.0
1.1199999999999997 86.0
1.1199999999999997 86.5
1.4899999999999998 83.0
1.4899999999999998 84.0
1.4899999999999998 85.0
1.4899999999999998 86.0
1.4899999999999998 86.5
In [ ]:
max_freq = 384182.3
data = dfs[0]
data = data[data['ratio']<1.3]

freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-df['currV'].min())*FREQVSCURR)
fig, ax = plt.subplots()
plot_spline_fit(ax=ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'], 
                s=0.0, 
                mfc='red', color='black', 
                title='')
plt.show()
plt.close()

betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
freqs = sorted(freqs)
plt.plot(freqs, betaPAs, 'o-', ms=5, label="")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
#plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f"2-body Decay Plot {''} ", **titledict) 
plt.show()
plt.close()
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
In [ ]:
max_freq = 384182.3
data = dfs[1]
data = data[data['ratio']<1.3]

freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-df['currV'].min())*FREQVSCURR)
fig, ax = plt.subplots()
plot_spline_fit(ax=ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'], 
                s=0.0, 
                mfc='red', color='black', 
                title='')
plt.show()
plt.close()

betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
freqs = sorted(freqs)
plt.plot(freqs, betaPAs, 'o-', ms=5, label="")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
#plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f"2-body Decay Plot {''} ", **titledict) 
plt.show()
plt.close()
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
In [ ]:
max_freq = 384182.3
data = dfs[2]
data = data[data['ratio']<1.3]

freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-df['currV'].min())*FREQVSCURR)
fig, ax = plt.subplots()
plot_spline_fit(ax=ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'], 
                s=0.0, 
                mfc='red', color='black', 
                title='')
plt.show()
plt.close()

betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
freqs = sorted(freqs)
plt.plot(freqs, betaPAs, 'o-', ms=5, label="")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
#plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f"2-body Decay Plot {''} ", **titledict) 
plt.show()
plt.close()
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
In [ ]:
max_freq = 384182.3
data = dfs[3]
data = data[data['ratio']<1.3]

freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-df['currV'].min())*FREQVSCURR)
fig, ax = plt.subplots()
plot_spline_fit(ax=ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'], 
                s=0.0, 
                mfc='red', color='black', 
                title='')
plt.show()
plt.close()

betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
freqs = sorted(freqs)
plt.plot(freqs, betaPAs, 'o-', ms=5, label="")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
#plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f"2-body Decay Plot {''} ", **titledict) 
plt.show()
plt.close()
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
In [ ]:
1//2
Out[ ]:
0
In [ ]:
0//2
Out[ ]:
0
In [ ]:
0//3
Out[ ]:
0
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'SemiFullRunSept29')
df = get_data_frame(MEASURE_FOLDER)
df.drop(columns='betaPAErr', inplace=True)
df.dropna(inplace=True)

dfc = df.copy()
df_grouped = df.groupby(by=['pump_reference', 'pump_AOM_freq'])
groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

max_freqs = [384182.3]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))

fig1, ax1s = plt.subplots(5)    # detuning
fig1b, ax1sb = plt.subplots(5)
fig1size = (8, 30)
fig1bsize= fig1size
fig1b.set_size_inches(fig1bsize)

fig2, ax2s = plt.subplots(2) # pump_reference
fig2b, ax2sb = plt.subplots(2)
fig2size = (8, 12)
fig2bsize= fig2size
fig2b.set_size_inches(fig2bsize)

for i, (df, max_freq)  in enumerate(zipped_data[:]):
    j1 = i%5
    j2 = i//5
    
    data = df.dropna()
    data = data[data['ratio'] < 1.3]
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-0.0)*FREQVSCURR)
    
    pref = data['pump_reference'].mean()
    detuning = 180-2*data['pump_AOM_freq'].mean()
    print(pref, detuning)
    
    
    ax1s[j1] = plot_spline_fit(ax1s[j1], 
                               x=freqs, y=data['ratio'], yerr=data['ratioErr']
                               ,scolor=f'C{j2}', mfc=f'C{j2}',color=f'C{j2}'
                               ,s=0.0, ms=5,linewidth=1.5, figsize=fig1size
                               ,label=f"Pump Amplitude = {pref:.2f}", fig=fig1)
    
    ax1s[j1].set_title(f"Detuning  = {detuning:.2f}", **titledict)
    ax1s[j1].legend()
    
    ax2s[j2] = plot_spline_fit(ax2s[j2], 
                               x=freqs, y=data['ratio'], yerr=data['ratioErr'],
                               scolor=f'C{j1}', mfc=f'C{j1}',color=f'C{j1}', 
                               s=0.0, ms=5, linewidth=1.5, figsize=fig2size,
                               label=f"Detuning  = {detuning:.2f}", fig=fig2)
    
    ax2s[j2].set_title(f"Pump Amplitude = { pref:.2f}", **titledict)
    ax2s[j2].legend()
    
    
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    
    ax1sb[j1].plot(freqs, betaPAs, 'o-', color=f'C{j2}', ms=5,  label=f"Pump Amplitude = {pref:.2f}")
    ax1sb[j1].set_xlabel(r'$\Delta$ (GHz)')
    ax1sb[j1].set_ylabel(r'$\beta_{\mathrm{eff}}$ ')
    ax1sb[j1].legend()
    ax1sb[j1].set_title(f"Detuning  = {detuning:.2f}", **titledict)
    
    ax2sb[j2].plot(freqs, betaPAs, 'o-',color=f'C{j1}', ms=5, label=f"Detuning  = {detuning:.2f}")
    ax2sb[j2].set_xlabel(r'$\Delta$ (GHz)')
    ax2sb[j2].set_ylabel(r'$\beta_{\mathrm{eff}}$ ')
    ax2sb[j2].legend()
    ax2sb[j2].set_title(f"Pump Amplitude = { pref:.2f}", **titledict)
    
fig1.tight_layout()
fig1b.tight_layout()
fig2.tight_layout()
fig2b.tight_layout()

fig1.savefig(os.path.join(MEASURE_FOLDER, 'lossFeaturesDet.png'))
plt.show()
plt.close()
fig1b.savefig(os.path.join(MEASURE_FOLDER, '2bodyDet.png'))
plt.show()
plt.close()

fig2.savefig(os.path.join(MEASURE_FOLDER, 'lossFeaturesPampl.png'))
plt.show()
plt.close()
fig2b.savefig(os.path.join(MEASURE_FOLDER, '2BodyPampl.png'))
plt.show()
plt.close()
100%|██████████| 465/465 [00:02<00:00, 159.80it/s]
1.1199999999999999 14.0
1.1199999999999997 12.0
1.1199999999999997 10.0
1.1199999999999997 8.0
1.1199999999999997 7.0
1.4899999999999998 14.0
1.4899999999999998 12.0
1.4899999999999998 10.0
1.4899999999999998 8.0
1.4899999999999998 7.0